<template>
  <view class="content">
    <view v-if="content_type ==='about_us_agreement'" v-html="commonInfo?.agreement.about_us_agreement"></view>

    <view v-if="content_type ==='user_agreement'" v-html="commonInfo?.agreement.user_agreement"></view>
  </view>
</template>

<script setup lang="ts">

  import {
    onLoad,
    onShow
  } from '@dcloudio/uni-app'
  import {
    ref
  } from 'vue'

  import {getCommonInfoApi } from '@/api/home'
  const content_type = ref("about_us_agreement")
  const commonInfo = ref()
  const get_common_info = async () => {
    const res = await getCommonInfoApi()
    commonInfo.value = res.result
    // console.log("res === ", res.result)
  }

  const content = ref()
  onLoad(async (option: any) => {
    if (option.type) {
      // console.log("--------")
      content_type.value = option.type
    }
    await get_common_info()
  })

</script>

<style>
.content {
  padding: 10rpx;
}
</style>
